﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Petroleum.Model;
using Petroleum.Tool;

namespace Petroleum.UC
{
    public partial class DocumensRequirementSelect : UserControl
    {
        FormMain main = new FormMain();
        public DocumensRequirementSelect(FormMain main)
        {
            InitializeComponent();
            this.main = main;
            List<KeyValuePair<string, string>> lstdocCom = new List<KeyValuePair<string, string>>()
            {
                new KeyValuePair<string, string>("doc","Documents Requirements（单井）"),
                new KeyValuePair<string, string>("doc1","Documents Requirements（丛式井）"),
            };
            cmdreq.Source = lstdocCom;
            cmdreq.SelectedIndex = 0;
            cmdreq.SelectedChangedEvent += Cmdreq_SelectedChangedEvent;
            Session.DocRequirements = AppConfig.TeamWordUrl + "docs.docx";
        }
        private void Cmdreq_SelectedChangedEvent(object sender, EventArgs e)
        {
            string teamString = cmdreq.SelectedValue;
            switch (teamString)
            {
                case "doc":
                    Session.DocRequirements = AppConfig.TeamWordUrl + "docs.docx";
                    this.img.Image = Properties.Resources.doc;
                    break;
                case "doc1":
                    Session.DocRequirements = AppConfig.TeamWordUrl + "docs1.docx";
                    this.img.Image = Properties.Resources.doc1;
                    break;
                default:
                    HZH_Controls.Forms.FrmTips.ShowTipsSuccess(this.FindForm(), "选择有误");
                    break;
            }
        }
        private void btnnext_BtnClick(object sender, EventArgs e)
        {
            main.AddControl(new Step6BHADesign(main));
        }
        private void btnup_BtnClick(object sender, EventArgs e)
        {
            main.AddControl(new StepADrillingTeamSelect(main));
        }
    }
}
